// Learn cc.Class:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
// Learn Attribute:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
var BaseSwitchLayer = require('./BaseSwitchLayer');
cc.Class(
{
    extends: BaseSwitchLayer,

    /**
     * 开始变阵
     */
    doAct()
    {
        this._super();
        var children = this.node.children;
        var childrenSize = this.node.getContentSize();
        if (children.length > 1)
        {
            childrenSize = children[0].getContentSize();
        }
        for (var i = 0; i < children.length; ++i)
        {
            children[i].runAction(cc.moveTo(this.timeAct, new cc.Vec2(i * childrenSize.width * 0.75, 0)));
        }
    }
});